package com.yulinlin.jdbc.serialize.impl;

import com.yulinlin.lang.util.JsonUtil;

import java.lang.reflect.Field;

public class AbstJsonSerialize<E> implements ITypeSerialize<E,String> {

    @Override
    public String serialize(E o) {
        return JsonUtil.toJson(o);
    }

    @Override
    public E unSerialize(String o,Field clazz) {
        return JsonUtil.parseByField(o,clazz);
    }

    @Override
    public boolean supportExtend() {
        return true;
    }
}
